package com.anolesoft.yr.mbus.code.service.gene.impl;

import com.anolesoft.yr.mbus.code.service.gene.GeneCodeService;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @author zhj
 * @date 2020/9/24 14:59
 */
@Component
public class GeneCodeServiceDemoImpl implements GeneCodeService {
    @Override
    public String getCode() {
        System.out.println(proxy.redisTemplate);
        return null;
    }

    /***
     * 重要
     */
    @PostConstruct
    public void init() {
        proxy = this;
    }

    private static GeneCodeServiceDemoImpl proxy;

    @Resource
    private RedisTemplate redisTemplate;
}
